Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API that allows reading many points #68

Merged
merged 2 commits into from
Mar 25, 2024
Merged

Conversation

tmontaigu
Copy link
Contributor

This adds to the API of the reader some functions
that allows to read many points in one call.

There are few variants, depending on how the user wants to be conservative with allocations.

Also ideally, there would be a
read_into(&mut self, buf: &mut [Point]) -> Result<u64> In order to avoid more allocations (especially the potential extra bytes), but for that there needs to exist a
Point::read_into(raw: &RawPoint, dest_point: &mut Point) or similar. Which could be added later.

The main point for these methods, is that it will later allow to make use of laz-rs parrallel decompressor to greatly speed-up reading LAZ files.

If needed, we could add later an iterator that returns vecs of points e.g:

fn chunks(points_per_chunk: u64) -> impl Iterator<Item=Vec<Point>>>

tmontaigu and others added 2 commits March 20, 2024 00:38
This adds to the API of the reader some functions
that allows to read many points in one call.

There are few variants, depending on how the user wants to be
conservative with allocations.

Also ideally, there would be a
`read_into(&mut self, buf: &mut [Point]) -> Result<u64>`
In order to avoid more allocations (especially the potential
extra bytes), but for that there needs to exist a
`Point::read_into(raw: &RawPoint, dest_point: &mut Point)`
or similar. Which could be added later.

The main point for these methods, is that it will later allow
to make use of laz-rs parrallel decompressor to greatly speed-up
reading LAZ files.

If needed, we could add later an iterator that returns vecs of points
e.g:
```
fn chunks(points_per_chunk: u64) -> impl Iterator<Item=Vec<Point>>>
```
@gadomski gadomski merged commit 5d62998 into gadomski:main Mar 25, 2024
2 checks passed
@tmontaigu tmontaigu deleted the read-n branch March 26, 2024 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants